home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / kernel / raid / miscutil.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-12-19  |  1.7 KB  |  51 lines

  1. /*
  2.  * miscutil.h --
  3.  *
  4.  *    Declarations of ...
  5.  *
  6.  * Copyright 1991 Regents of the University of California
  7.  * Permission to use, copy, modify, and distribute this
  8.  * software and its documentation for any purpose and without
  9.  * fee is hereby granted, provided that this copyright
  10.  * notice appears in all copies.  The University of California
  11.  * makes no representations about the suitability of this
  12.  * software for any purpose.  It is provided "as is" without
  13.  * express or implied warranty.
  14.  *
  15.  * $Header: /cdrom/src/kernel/Cvsroot/kernel/raid/miscutil.h,v 1.1 92/06/25 17:20:49 eklee Exp $ SPRITE (Berkeley)
  16.  */
  17.  
  18. #ifndef _MISCUTIL
  19. #define _MISCUTIL
  20.  
  21. #define RoundUp(size, modulus)    ((((size)+(modulus)-1)/(modulus))*(modulus))
  22.  
  23. typedef struct {
  24.     Sync_Semaphore    mutex;
  25.     Sync_Condition    wait;
  26.     int            numIO;
  27.     ReturnStatus    status;
  28. } SyncControl;
  29.  
  30. typedef struct {
  31.     Sync_Semaphore    mutex;
  32.     Sync_Condition    wait;
  33.     int            numIO;
  34.     ReturnStatus    status;
  35.     void        (*doneProc)();
  36.     int            clientData;
  37. } AsyncControl;
  38.  
  39.  
  40. extern void Raid_InitSyncControl _ARGS_((SyncControl *syncControlPtr));
  41. extern void Raid_StartSyncIO _ARGS_((SyncControl *syncControlPtr));
  42. extern ReturnStatus Raid_WaitSyncIO _ARGS_((SyncControl *syncControlPtr));
  43. extern int Raid_SyncDoneProc _ARGS_((SyncControl *syncControlPtr, ReturnStatus status));
  44. extern ReturnStatus Raid_DevReadSync _ARGS_((DevBlockDeviceHandle *devHandlePtr, int devOffset, char *buffer, int bufSize));
  45. extern ReturnStatus Raid_DevWriteSync _ARGS_((DevBlockDeviceHandle *devHandlePtr, int devOffset, char *buffer, int bufSize));
  46. extern ReturnStatus Raid_DevWriteInt();
  47. extern ReturnStatus Raid_DevReadInt();
  48. extern void Raid_WaitTime _ARGS_((int ms));
  49.  
  50. #endif /* _MISCUTIL */
  51.